package com.example.evil;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

//用于手动启动我们的HijackService，真正的恶意软件通常不会有这样的一个Activity
public class StartServiceActivity extends Activity {
    Button startButton = null;
    //Button stopButton = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        startButton = (Button)findViewById(R.id.StartServiceButton);
        //stopButton = (Button)findViewById(R.id.StopServiceButton);

        startButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent2 = new Intent(StartServiceActivity.this, HijackService.class);
                startService(intent2);
            }
        });
       /*stopButton.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View view) {
               Intent intent = new Intent(StartServiceActivity.this, HijackService.class);
               stopService(intent);
           }
       });*/
    }
}
